<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>

</h:head>
<title>Cadastro de Loja</title>
<h:body style="background-color: transparent">
	<h:form style="font-size: 12px" id="cadastro-de-lojas">
		<p:messages autoUpdate="true" />
		<center>
			<h:panelGrid >
				<p:panel id="CadastroDeLoja" header="Nova Loja:">
				
					<h:panelGrid columns="0">

						<h:outputText value="Codigo: " />
						<p:inputText id="codigo" disabled="true" value="Novo" />

						<h:outputText value="Razão Social:" />
						<p:inputText id="rs" maxlength="50" required="true"
							value="#{lojaBean.loja.pessoaJuridica.razaoSocial}"
							label="Razão Social">
							<f:validateLength minimum="5" />
						</p:inputText>

						<p:message for="rs" display="icon" />

						<h:outputText value="Fantasia:" />
						<p:inputText id="fan" maxlength="50"
							value="#{lojaBean.loja.pessoaJuridica.fantasia}" />

						<h:outputText value="CNPJ:" />
						<p:inputMask id="cnpj"
							value="#{lojaBean.loja.pessoaJuridica.cnpj}"
							mask="99.999.999/9999-99"/>

						<h:outputText value="Endereço:" />
						<p:inputText id="end" maxlength="30"
							value="#{lojaBean.loja.pessoaJuridica.endereco.endereco}" />

						<h:outputText value="Complemento:" />
						<p:inputText id="com" maxlength="30"
							value="#{lojaBean.loja.pessoaJuridica.endereco.complemento}" />

						<h:outputText value="Bairro:" />
						<p:inputText id="bar" maxlength="30"
							value="#{lojaBean.loja.pessoaJuridica.endereco.bairro}" />

						<h:outputText value="Cidade:" />
						<p:inputText id="cid" maxlength="10"
							value="#{lojaBean.loja.pessoaJuridica.endereco.cidade}" />

						<h:outputText value="Cep:" />
						<p:inputMask id="cep" mask="99999-999"
							value="#{lojaBean.loja.pessoaJuridica.endereco.cep}" />


						<h:outputText value="Estado:" />
						<p:selectOneMenu id="estado"
							value="#{lojaBean.loja.pessoaJuridica.endereco.estado}"
							effect="fold">
							<f:selectItems value="#{constantes.estados}" />
						</p:selectOneMenu>

						<h:outputText value="Telefone:" />
						<p:inputMask id="tel1"
							value="#{lojaBean.loja.pessoaJuridica.contato.telefone}"
							mask="(99)9999-9999" />

						<h:outputText value="Telefone:" />
						<p:inputMask id="tel2"
							value="#{lojaBean.loja.pessoaJuridica.contato.telefoneAux}"
							mask="(99)9999-9999" />

						<h:outputText value="Email:" />
						<p:inputText id="email1" maxlength="50"
							value="#{lojaBean.loja.pessoaJuridica.contato.email}" />

						<h:outputText value="Email:" />
						<p:inputText id="email2" maxlength="50"
							value="#{lojaBean.loja.pessoaJuridica.contato.emailAux}" />

						<h:outputText value="Site: " />
						<p:inputText id="site" maxlength="50"
							value="#{lojaBean.loja.pessoaJuridica.contato.site}" />
					</h:panelGrid>

				</p:panel>
				<p:panel>
					<center>

						<p:commandButton id="bntCadastrar" value="Cadastrar"
							action="#{lojaBean.adicionar}" icon="ui-icon-disk">

						</p:commandButton>

						<p:commandButton value="Voltar" action="menu.xhtml" />

						<p:commandButton value="Listar Todas"
							action="lista-de-lojas.xhtml" />

					</center>
				</p:panel>

			</h:panelGrid>
		</center>

	</h:form>
</h:body>

</html>